package com.durian.financial.api.domain.enums;

import com.baomidou.mybatisplus.annotation.EnumValue;
import com.fasterxml.jackson.annotation.JsonValue;
import lombok.Getter;

import java.util.EnumSet;
import java.util.HashMap;
import java.util.Map;

/**
 * @Author zhouzhiyi
 * @Date 2022/6/30 13:52
 * @Description 金融产品申请状态
 */
@Getter
public enum ProductApplyEnum {

    CHECK_PENDING(0,"待审核"),PASSED(1,"已通过"),NOT_PASSED(2,"未通过");

    @EnumValue
    @JsonValue
    private final Integer index;
    private final String value;

    ProductApplyEnum(Integer index, String value) {
        this.index = index;
        this.value = value;
    }

    /**
     * 获取金融产品申请状态Map
     */
    public static Map<Integer,String> getProductApplyEnumMap(){

        Map<Integer, String> map = new HashMap<>();

        for (ProductApplyEnum temp : EnumSet.allOf(ProductApplyEnum.class)) {

            map.put(temp.getIndex(),temp.getValue());
        }
        return map;
    }

}
